package com.base.cn.platform.os.service.exam.paper;

import com.base.cn.platform.os.entity.exam.paper.ExamPaper;
import com.base.cn.platform.os.entity.exam.paper.ExamPaperCondition;
import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 试卷接口
 * @author s.li
 * @date 2018/12/04
 */
@FeignClient(name = ExamBaseService.appName,configuration = FeignAuthConfig.class)
public interface ExamPaperService extends ExamBaseService {

    /**
     * 查询数据统计
     * @return Map<String, BigDecimal>
     */
    @RequestMapping(contextPath + "/statisticsExamPaper")
    Map<String, BigDecimal> statisticsExamPaper();

    /**
     * 保存试卷
     * @param examPaper 试卷对象数据
     */
    @RequestMapping(contextPath + "/saveExamPaper")
    Map<String,Object> saveExamPaper(@RequestBody Map<String, Object> examPaper);

    /**
     * 通过ID，查询试卷
     * @param condition 查询条件
     * @return 试卷对象
     */
    @RequestMapping(contextPath + "/findExamPaperById")
    ExamPaper findExamPaperById(@RequestBody Map<String, Object> condition);

    /**
     * 修改试卷状态
     * @param ids 试卷ID串
     * @param status 0.未发布 1.已发布 2.已禁用 3.已删除
     */
    @RequestMapping(contextPath + "/updateExamPaperStatus")
    Map<String,Object> updateExamPaperStatus(@RequestParam("ids") String ids,
                                             @RequestParam("status") int status);

    /**
     * 置顶和取消置顶
     * @param id 试卷ID
     * @param stick 置顶状态，1否，2是
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/stickyOperation")
    Map<String,Object> stickyOperation(@RequestParam("id") BigDecimal id,
                                       @RequestParam("stick") int stick);

    /**
     * 分页查询试卷列表
     * @param condition 试卷查询条件
     * @param currentPage 页码
     * @param pageSize 查询数量
     * @return PageInfo<ExamPaper>
     */
    @RequestMapping(contextPath + "/findExamPaperListPage")
    Map<String,Object> findExamPaperListPage(@RequestBody Map<String, Object> condition,
                                             @RequestParam("currentPage") int currentPage,
                                             @RequestParam("pageSize") int pageSize);

    /**
     * 查询试题Map
     * @param condition 查询条件
     * @return Map<BigDecimal,ExamPaper>
     */
    @RequestMapping(contextPath + "/findExamPaperMap")
    Map<BigDecimal,ExamPaper> findExamPaperMap(@RequestBody ExamPaperCondition condition);

    /**
     * 查询试题Map
     * @param condition 查询条件
     * @return Map<BigDecimal,ExamPaper>
     */
    @RequestMapping(contextPath + "/findExamPaperMaps")
    Map<BigDecimal,Map<String,Object>> findExamPaperMaps(@RequestBody ExamPaperCondition condition);

    /**
     * 查询试题List
     * @param condition 查询条件
     * @return List<ExamPaper>
     */
    @RequestMapping(contextPath + "/findExamPaperList")
    List<Map<String,Object>> findExamPaperList(@RequestBody Map<String, Object> condition);

    /**
     * 查询试卷总数量数据
     * @return ExamPaperSumCount
     */
    @RequestMapping(contextPath + "/queryExamPaperSumCount")
    Map<String,Integer> queryExamPaperSumCount();
}
